package com.ketti.team;

import android.app.TabActivity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;

import android.widget.TabHost;
import android.widget.TextView;

/**
 * @author JaeGwang Ryu
 * @since 		@version
 * 2010,04,23 	0.10	Create tab that height is height of text.
 * 
 * */
public class EditorActivity extends TabActivity {
	
	private TabHost mTabHost;
		
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
              
        mTabHost = getTabHost();
               
        LayoutInflater.from(this).inflate(R.layout.main,
        		mTabHost.getTabContentView(), true);
 
        createTabAndSourceView("sourceView 1");
        createTabAndSourceView("sourceView 2");
        createTabAndSourceView("sourceView 2");        
   }
   

	public void createTabAndSourceView(String filename)
    {	
		TextView label = new TextView(this);
		label.setText(filename);
		label.setGravity(Gravity.CENTER);
		label.setBackgroundColor(Color.GRAY);
		
		// put label view without icon view instead of TabWidget in new tab
    	mTabHost.addTab(mTabHost.newTabSpec("tab1")
    			.setIndicator(label)
    			.setContent(R.id.tabhost));
    }
}